import Vue from 'vue'
import Router from 'vue-router'
import Register from '@/pages/register/Register' //注册
import Login from '@/pages/login/Login' //登录
import Xfsq from '@/pages/xfsq/Xfsq'  //消费神器
import Txjl from '@/pages/xfsq/Txjl'  //提现记录
import Home from '@/components/Home' // 首页
import MyHome from '@/components/MyHome' // 我的
import Repayment from '@/components/Repayment' // 轻松还卡
import SpeedCard from '@/components/SpeedCard' // 极速办卡
import Consumption from '@/pages/xfsq/Xfsq' // 消费神器
import Fxmx from '@/pages/xfsq/Fxmx' // 返现明细
import Gzsm from '@/pages/xfsq/Gzsm' // 规则说明
import Partner from '@/components/Partner' // 合伙人
import myBalance from '@/components/myBalance' // 我的余额
import MerchantContact from '@/components/MerchantContact' //
import ChangePassword from '@/components/ChangePassword' // 修改密码
import CustomerService from '@/components/CustomerService' // 联系客服
import Recharge from '@/components/Recharge' // 充值
import Record from '@/components/Record' // 预审记录
import InputInfo from '@/components/InputInfo' // 立即办卡
import Reward from '@/components/Reward' // 奖励说明
import Qrcode from '@/components/Qrcode' // 分享好礼
import progress from '@/components/progress' // 进度查询
import GainRecord from '@/components/GainRecord' // 收益记录
import Wjmm from '@/components/Wjmm' // 忘记密码
import Sssds from '@/pages/xfsq/Sssds' // 忘记密码
import withdraw from '@/components/withdraw' // 忘记密码
import banka1 from '@/components/banka1' // 进账收益
import banka2 from '@/components/banka2' // 我的二维码
import wdtjr from '@/components/wdtjr' // 我的推荐人
import wdxj from '@/components/wdxj' // 我的下级
import gmhhr from '@/components/gmhhr' // 我的下级
import wyte from '@/components/Wyte' // 我要提额
import hhrsymx from '@/components/hhrsymx' // 合伙人收益明细
import hhrPosList from '@/components/hhrPosList' // 合伙人pos机列表









import err404 from '@/components/404' // 404
import AddCard from '@/pages/addCard/AddCard' //添加银行卡
//后台
import Mhome from '@/manage/Mhome' //后台主页
import Mlogin from '@/manage/Mlogin' //后台登陆
import UploadImg from '@/manage/home/UploadImg' //上传图片
import userPos from '@/manage/userPos' // 合伙人pos机列表

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      children:[
        {
          path:'/myhome',
          name:'myhome', // 我的
          component:MyHome,
          alias:'/'
        },
        {
          path:'repayment', // 轻松还卡
          name:'Repayment',
          component:Repayment
        },
        {
          path:'partner', // 合伙人
          name:'Partner',
          component:Partner
        },
        {
          path:'speedcard', // 极速办卡
          name:'SpeedCard',
          component:SpeedCard
        },
        {
          path:'consumption', // 消费神器
          name:'Consumption',
          component:Consumption
        },
        {
          path:'Fxmx', // 消费神器
          name:'Fxmx',
          component:Fxmx
        },
        {
          path:'Txjl', // 消费神器
          name:'Txjl',
          component:Txjl
        },
      ]
    },
    {
      path:'/userPos', // 合伙人收益列表
      name:'userPos',
      component:userPos
    },
    {
      path:'/hhrPosList', // 合伙人收益列表
      name:'hhrPosList',
      component:hhrPosList
    },
    {
      path:'/record', // 预审记录
      name:'Record',
      component:Record
    },
    {
      path:'/inputinfo', // 预审记录
      name:'InputInfo',
      component:InputInfo
    },
    {
      path:'/reward',
      name:'Reward',
      component:Reward // 奖励说明
    },
    {
      path:'/Qrcode',
      name:'Qrcode',
      component:Qrcode // 分享好礼
    },
    {
      path:'/progress',
      name:'progress',
      component:progress // 进度查询
    },
    {
      path:'/gainrecord',
      name:'GainRecord',
      component:GainRecord // 收益记录
    },
    {
      path:'/withdraw',
      name:'withdraw',
      component:withdraw // 提现
    },
    {
      path:'/banka1',
      name:'banka1',
      component:banka1 // 办卡收益
    },
    {
      path:'/banka2',
      name:'banka2',
      component:banka2 // 我的二维码推广
    },
    {
      path:'/wdtjr', // 我的推荐人
      name:'wdtjr',
      component:wdtjr
    },
    {
      path:'/wdxj', // 我的下级
      name:'wdxj',
      component:wdxj
    },
    {
      path:'/hhrsymx', // 我的下级
      name:'hhrsymx',
      component:hhrsymx
    },
    {
      path:'/wyte', // 我要提额
      name:'wyte',
      component:wyte
    },
    {
      path:'/gmhhr', // 购买合伙人
      name:'gmhhr',
      component:gmhhr
    },
    {
      path: '/Register',
      name: 'Register',
      component: Register
    },{
      path: '/Login',
      name: 'Login',
      component: Login
    },{
      path: '/Xfsq',
      name: 'Xfsq',
      component: Xfsq
    },{
      path: '/Gzsm',
      name: 'Gzsm',
      component: Gzsm
    },
    {
      path: '/recharge',  // 充值
      name: 'Recharge',
      component: Recharge
    },
    {
      path: '/mybalance',
      name: 'myBalance',
      component: myBalance,
      beforeEnter: (to,from,next)=>{
        console.log(to)
        console.log(from)
        next();
        // next({path:'/ChangePassword'});
      }
    },
    {
      path: '/merchantcontact',
      name: 'MerchantContact',
      component: MerchantContact
    },
    {
      path: '/changepassword',
      name: 'ChangePassword',
      component: ChangePassword
    },
    {
      path: '/customerservice',
      name: 'CustomerService',
      component: CustomerService
    },
    {
      path: '/goHome', // 返回首页
      redirect: '/'
    },
    {
      path: '/gomybalance/:userId/:userName',
      redirect: '/mybalance/:userId(\\d+)/:userName'
    },
    {
      path:'*',
      component:err404
    },
    {
      path:'/AddCard',
      name: 'AddCard',
      component:AddCard
    },
    {
      path:'/Mhome',
      name: 'Mhome',
      component:Mhome
    },
    {
      path:'/Mlogin',
      name: 'Mlogin',
      component:Mlogin
    },
    {
      path:'/UploadImg',
      name: 'UploadImg',
      component:UploadImg
    },
    {
      path:'/Wjmm',
      name: 'Wjmm',
      component:Wjmm
    },
    {
      path:'/Sssds',
      name: 'Sssds',
      component:Sssds
    },


  ]
})

